import Vue from 'vue'
import Router from 'vue-router'
import Global from '@/components/Global'
import List from '@/components/List'
import AddList from '@/components/AddList'
import Login from '@/components/Login'
import Register from '@/components/Register'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      component: Login,
      name: 'Login'
    },
    {
      path: '/register',
      component: Register,
      name: 'Register'
    },

    {
      path: '/global',
      name: 'Global',
      redirect: '/list',
      component: Global,
      children: [
        {
          path: '/list',
          name: 'List',
          component: List
        },
        {
          path: '/add',
          name: 'AddProduct',
          component: AddList
        }
      ]
    }

  ]
})
